
package cn.com.pusai.common.util;

import javax.servlet.http.HttpServletRequest;

public class ServletUtil
{

	private static ThreadLocal requestThreadLocal = new ThreadLocal();

	public ServletUtil()
	{
	}

	public static void bindCurrentHttpRequest(HttpServletRequest request)
	{
		requestThreadLocal.set(request);
	}

	public static HttpServletRequest getCurrentHttpRequest()
	{
		return (HttpServletRequest)requestThreadLocal.get();
	}

	public static void cancelBindCurrentRequest(HttpServletRequest request)
	{
		requestThreadLocal.set(null);
	}

}
